package com.dkd.flow.emums;
import com.baomidou.mybatisplus.annotation.IEnum;
import com.fasterxml.jackson.annotation.JsonValue;
import io.swagger.models.auth.In;

import java.util.Arrays;
public enum TaskStatus implements IEnum<Integer> {
    INITIATE_APPLICATION(1,
            "发起"),
    RE_SUBMIT(12,
            "重新提交"),
    RE_SUBMIT_ALL(13,
            "重新提交所有"),
    UNDER_APPROVAL(2,
            "审批中"),
    APPROVAL(3,
            "已审批"),
    REJECT_AND_END(4,
            "已拒绝并关闭"),
    PREVIEW(5,
            "已查阅"),
    RETURNED(6,
            "已驳回"),

    RETURNED_ALL(7,
            "已驳回所有"),
    TRANSFERRED(8,
            "已转交"),
    CANCELED(9,
            "已取消"),
    RECALL(10,
            "已撤回"),
    DRAFT(11,
            "草稿"),
    COPIED(14,
            "已抄送");
    private final Integer value;
    private final String name;
    TaskStatus(Integer value,
               String name) {
        this.value = value;
        this.name = name;
    }
    @Override
    @JsonValue
    public Integer getValue() {
        return value;
    }
    public String getName() {
        return name;
    }
    public static TaskStatus getTaskStatusByValue(Integer value) {
        return Arrays.stream(TaskStatus.values())
                .filter(fv -> fv.value.equals(value))
                .findFirst()
                .orElse(null);
    }
}
